package module1;

import java.util.Scanner;

public class dynamicArray {

    public static void main(String[] args) {

        int arraySize = 10;
        System.out.println("请输入数组数据!");
        String []array = new String[arraySize];
        Scanner scanner = new Scanner(System.in);
        for (int i=0;i<arraySize;i++){
            if (i==arraySize*0.8){
                String [] newArray = new String[(int) (arraySize*1.5)];
                System.arraycopy(array, 0, newArray, 0, array.length);
                System.out.println("原数组的长度:" + arraySize);
                System.out.println("新数组的长度:" + newArray.length);
                System.out.println("新数组的内容:" + newArray.length);

                for (int j=0;j<newArray.length;j++){
                    System.out.println(newArray[j]);
                }
                break;
            }

            String input = scanner.next();
            array[i] = input;
        }




    }

}
